/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package aso.upna.net;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author triki
 */
public class TcpObjectSend {

    public static boolean sendTo(Socket sock,Object obj)
    {
        try
        {
            ObjectOutputStream oos = new ObjectOutputStream(sock.getOutputStream());
            oos.writeObject(obj);
            return true;
        }
        catch (IOException ex)
        {
            ex.printStackTrace();
            return false;
        }
    }
}
